package com.example.myapplication.ui.Home.fragments;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.example.myapplication.R;
import com.example.myapplication.base.BaseFragment;
import com.example.myapplication.ui.adapter.MyAdapter;
import com.example.myapplication.ui.adapter.baseadapter.OnItemClickListeners;
import com.example.myapplication.ui.adapter.baseadapter.ViewHolder;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;


public class MyFragment extends BaseFragment implements OnItemClickListeners {

    @BindView(R.id.rc_view)
    RecyclerView mRcView;
    @Override
    protected int getLayoutId() {
        return R.layout.fragment_my;
    }

    @Override
    protected void initView() {
        List<String>  lists =new ArrayList();
        lists.add("姓名:");
        lists.add("性别:");
        lists.add("年龄:");
        lists.add("民族:");
        MyAdapter adapter =new MyAdapter(getActivity(),new ArrayList(),false,lists);
        mRcView.setLayoutManager(new LinearLayoutManager(getActivity()));
        mRcView.setAdapter(adapter);
        adapter.setOnItemClickListener(this);
        List  list =new ArrayList();
        list.add("张三");
        list.add("男");
        list.add("24");
        list.add("汉族");
        adapter.setNewData(list);
    }

    @Override
    public void showError(String msg) {

    }

    @Override
    public void onItemClick(ViewHolder viewHolder, Object data, int position) {

    }
}
